package com.empire.module.member.controller.admin.user.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class PersonCurInfoVo {
    @Schema(description = "人员id", example = "1")
    private Integer id;
    @Schema(description = "姓名", example = "1")
    private String name;
    @Schema(description = "头像地址", example = "1")
    private String avatar;
    @Schema(description = "证件号码", example = "1")
    private String paperNumber;
    @Schema(description = "护照号", example = "H4530923")
    private String passportNumber;
    @Schema(description = "会员身份证号码", example = "100101195809133242")
    private String idcard;
    @Schema(description = "是否护照：1-是，2-是身份证号", example = "1")
    private Integer foreigner;
    @Schema(description = "用户分组编号", example = "1")
    private Long groupId;
    @Schema(description = "总预警数量", example = "1")
    private Integer totalWarn = (int) (Math.random() * 100) + 1;
    @Schema(description = "未读预警数", example = "1")
    private Integer unreadWarn = (int) (Math.random() * 100) + 1;
    @Schema(description = "最后位置", example = "1")
    private String lastLocation = "江苏省嵊州市王八路";
    @Schema(description = "用户分组", example = "购物达人")
    private String groupName;

    @Schema(description = "最后位置时间", example = "1")
    private String lastLocationTime;

    @Schema(description = "预警总数", example = "1")
    private Integer warnCount;

    @Schema(description = "已读总数", example = "1")
    private Integer readTotal;

    @Schema(description = "已读总数", example = "1")
    private Integer unreadTotal;

    public String getPaperNumber() {
        if (foreigner != null) {
            if (foreigner == 1) {
                paperNumber = passportNumber;
            }
            if (foreigner == 2) {
                paperNumber = idcard;
            }
        }
        return paperNumber;
    }
}
